package br.org.prodUnicamp.services;

public class ServicosPortTypeProxy implements br.org.prodUnicamp.services.ServicosPortType {
  private String _endpoint = null;
  private br.org.prodUnicamp.services.ServicosPortType servicosPortType = null;
  
  public ServicosPortTypeProxy() {
    _initServicosPortTypeProxy();
  }
  
  public ServicosPortTypeProxy(String endpoint) {
    _endpoint = endpoint;
    _initServicosPortTypeProxy();
  }
  
  private void _initServicosPortTypeProxy() {
    try {
      servicosPortType = (new br.org.prodUnicamp.services.ServicosLocator()).getServicosHttpSoap11Endpoint();
      if (servicosPortType != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)servicosPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)servicosPortType)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (servicosPortType != null)
      ((javax.xml.rpc.Stub)servicosPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public br.org.prodUnicamp.services.ServicosPortType getServicosPortType() {
    if (servicosPortType == null)
      _initServicosPortTypeProxy();
    return servicosPortType;
  }
  
  public br.org.prodUnicamp.services.xsd.Produto[] getListProdutoByFilter(java.lang.String nome, java.lang.String categoria, java.lang.String fabricante, java.lang.Double pesoMin, java.lang.Double pesoMax) throws java.rmi.RemoteException{
    if (servicosPortType == null)
      _initServicosPortTypeProxy();
    return servicosPortType.getListProdutoByFilter(nome, categoria, fabricante, pesoMin, pesoMax);
  }
  
  public br.org.prodUnicamp.services.xsd.Categoria[] getListCategoria() throws java.rmi.RemoteException{
    if (servicosPortType == null)
      _initServicosPortTypeProxy();
    return servicosPortType.getListCategoria();
  }
  
  public br.org.prodUnicamp.services.xsd.Fabricante[] getListFabricante() throws java.rmi.RemoteException{
    if (servicosPortType == null)
      _initServicosPortTypeProxy();
    return servicosPortType.getListFabricante();
  }
  
  public br.org.prodUnicamp.services.xsd.Produto getProdutoByCodigo(java.lang.Long codigo) throws java.rmi.RemoteException{
    if (servicosPortType == null)
      _initServicosPortTypeProxy();
    return servicosPortType.getProdutoByCodigo(codigo);
  }
  
  
}